﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NewRen.Models;
using NewRen.Models.ViewModel;

namespace NewRen.Areas.Mobile.Controllers
{
    public class HomeController : BaseController
    {
        // GET: Mobile/Home
        public ActionResult Index()
        {
            List<Models.User> users = new List<Models.User>();
            List<vUser> _users = new List<vUser>();
            users = db.Users.Where(u => u.IsShow).OrderByDescending(u => u.Priority).Take(10).ToList();
            foreach (var item in users)
            {
                _users.Add(new vUser(item));
            }
            ViewBag.Users = _users;
            return View();
        }
    }
}